package messages;

public class RemoveBuddyMessage extends Message
{
	private String type;
	private String from;
	private String to;
	
	public RemoveBuddyMessage() {super("RemoveBuddy");}
	public RemoveBuddyMessage(String type, String from, String to)
	{
		super("RemoveBuddy");
		this.type = type;
		this.from = from;
		this.to = to;
	}
	

	public void setType(String type) {this.type = type;}
	public void setFrom(String from) {this.from = from;}
	public void setTo(String to) {this.to = to;}
	
	public String getType() {return type;}
	public String getFrom() {return from;}
	public String getTo() {return to;}
	
	public void printMessage()
	{
		System.out.println("Message (from: " + from + ") (to: " + to + ")");
//		System.out.println("Sent at: " + timestamp);
//		System.out.println("Text: " + text);
		System.out.println("Text: " + from + " Added Buddy - " + to);
		System.out.println();
	}
	
	// return an XML-formatted version of the message
	public String toXML()
	{
		String message = "<message>";
        message += "<type>RemoveBuddy</type>";
        message += "<from><username>" + from + "</username></from>";
        message += "<to><username>" + to + "</username></to>";
        message += "</message>";
        
        return message;
	}
}
